<!-- 单位 -->
<template>
  <el-form-item prop="comment" label="单位：">
    <el-input
      v-model="formStore.selectQuestion.unit"
      @blur="handleBlur"
      @keyup.enter.native="handleBlur"
      maxlength="5"
    />
  </el-form-item>
</template>

<script lang="ts" setup>
import { useFormStore } from "@bis/stores/form";
import { editQue } from "../../../utils";

const formStore = useFormStore();
const oldVal = formStore.selectQuestion.unit;

const handleBlur = () => {
  if (formStore.selectQuestion.unit !== oldVal) {
    // 调用保存
    editQue(formStore.selectQuestion, formStore);
  }
};
</script>
